Hi,
I need to write an own server for DOORS, it must be an extention of initDXLServer function, which implementation I could not find, unfortunatly.
The idea is, that there schould be some minimal security check in it, which is obviosly not done by initDXLServer.
It is also expected, that the server will have no GUI and schould run together with a normal GUI DOORS session.
I have a small server script example, which works, but - as expected - locks DOORS session untill the server gets the "shutdown_" string.
IPC ipc = server 5078;
string request, response;
bool shutdown = false;
while (!shutdown){
if (accept(ipc)){
while (recv(ipc, request)){
print "request: " request "\n";
if (request=="shutdown_"){
shutdown = true;
break;
}
if (request=="quit_"){
break;
}
response = eval_(request);
send(ipc, response)
}
disconnect(ipc)
}
}
The question is:
1) can I have the initDXLServer code to start with?
2) if answer to "1" is "no", is there a way to make this server code interruptable by DOORS GUI or otherwise put it to background?
Thank you in advance for your help!
SystemAdmin - Wed Dec 19 09:57:22 EST 2012 |
|
Re: TCP DXL Server in background OurGuest - Wed Dec 19 16:16:41 EST 2012
I think what you are asking is: Is it possible to have DOORS do parallel processing. Someone may have figure out away but never heard anyone doing it.
|
|
Re: TCP DXL Server in background SystemAdmin - Thu Dec 20 02:00:05 EST 2012 OurGuest - Wed Dec 19 16:16:41 EST 2012
I think what you are asking is: Is it possible to have DOORS do parallel processing. Someone may have figure out away but never heard anyone doing it.
Thank you for your answer!
But, no, I did not meant that I need a parallel processing.
DOORS is single threaded, but somehow DOORS GUI applications work, and initDXLServer function also works the way they do not lock other DOORS windows.
The question is: How?
|
|
Re: TCP DXL Server in background Mathias Mamsch - Thu Dec 20 05:11:35 EST 2012 SystemAdmin - Thu Dec 20 02:00:05 EST 2012
Thank you for your answer!
But, no, I did not meant that I need a parallel processing.
DOORS is single threaded, but somehow DOORS GUI applications work, and initDXLServer function also works the way they do not lock other DOORS windows.
The question is: How?
Well first of all you need to know that although DOORS is single threaded you can have multiple DXL active at the same time without blocking DOORS with GUIs. The GUI thread of DOORS processes the Window messages forwarding messages to the DXL windows, that can react to events. Using the DXL timer you can have a DXL be executed "in background" as long as you have only operations that take a short time.
In BranchManager we use this for calculating the module comparisons in background, so people can already start merging while the modules are not yet compared. It worked reasonably good. I posted an example on how to do that here:
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14850573�
Now the problem with the DXL socket functions is, that you do not have non-blocking communication. That means, that you WILL lock up DOORS when you wait for connections, etc. No way around this with those functions. Therefore for your purpose they seem to be useless.
I have spent some time on googling for the DXL Debugger several month ago and again today, but I could not find a native COM library that would allow you to open a non blocking socket for receiving data. So I guess you would have a couple of options:
-
Use a 'commercial' one like w3sockets or the winsock COM library to accept connections and poll data from the connections.
-
Use a commandline tool like netcat to listen for sockets and get the data from your DXL script from there.
-
Implement your own server, that listens for connections, caches the data and provides it to the DXL script.
If you want to follow one of those approaches and need help, just post a message.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: TCP DXL Server in background SystemAdmin - Fri Dec 21 03:48:05 EST 2012 Mathias Mamsch - Thu Dec 20 05:11:35 EST 2012
Well first of all you need to know that although DOORS is single threaded you can have multiple DXL active at the same time without blocking DOORS with GUIs. The GUI thread of DOORS processes the Window messages forwarding messages to the DXL windows, that can react to events. Using the DXL timer you can have a DXL be executed "in background" as long as you have only operations that take a short time.
In BranchManager we use this for calculating the module comparisons in background, so people can already start merging while the modules are not yet compared. It worked reasonably good. I posted an example on how to do that here:
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14850573�
Now the problem with the DXL socket functions is, that you do not have non-blocking communication. That means, that you WILL lock up DOORS when you wait for connections, etc. No way around this with those functions. Therefore for your purpose they seem to be useless.
I have spent some time on googling for the DXL Debugger several month ago and again today, but I could not find a native COM library that would allow you to open a non blocking socket for receiving data. So I guess you would have a couple of options:
-
Use a 'commercial' one like w3sockets or the winsock COM library to accept connections and poll data from the connections.
-
Use a commandline tool like netcat to listen for sockets and get the data from your DXL script from there.
-
Implement your own server, that listens for connections, caches the data and provides it to the DXL script.
If you want to follow one of those approaches and need help, just post a message.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Hello Mathias,
Thank you for your answer! It clarifyed the situation for me.
I guess it can only be the 3-rd possibility for me, and at this point I will have to put this task aside, since it is not the priority task.
|
|
Re: TCP DXL Server in background SystemAdmin - Sat Dec 22 14:42:54 EST 2012 Mathias Mamsch - Thu Dec 20 05:11:35 EST 2012
Well first of all you need to know that although DOORS is single threaded you can have multiple DXL active at the same time without blocking DOORS with GUIs. The GUI thread of DOORS processes the Window messages forwarding messages to the DXL windows, that can react to events. Using the DXL timer you can have a DXL be executed "in background" as long as you have only operations that take a short time.
In BranchManager we use this for calculating the module comparisons in background, so people can already start merging while the modules are not yet compared. It worked reasonably good. I posted an example on how to do that here:
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14850573�
Now the problem with the DXL socket functions is, that you do not have non-blocking communication. That means, that you WILL lock up DOORS when you wait for connections, etc. No way around this with those functions. Therefore for your purpose they seem to be useless.
I have spent some time on googling for the DXL Debugger several month ago and again today, but I could not find a native COM library that would allow you to open a non blocking socket for receiving data. So I guess you would have a couple of options:
-
Use a 'commercial' one like w3sockets or the winsock COM library to accept connections and poll data from the connections.
-
Use a commandline tool like netcat to listen for sockets and get the data from your DXL script from there.
-
Implement your own server, that listens for connections, caches the data and provides it to the DXL script.
If you want to follow one of those approaches and need help, just post a message.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Hello
Some points:
>
> I think what you are asking is: Is it possible to have DOORS do parallel processing. Someone may have figure out away but never heard anyone doing it.
This ist not as difficult as you may think. It is only "expensive" because you need two (or more) doors licences to do it. The problems with your cost center responsible are more complicate than the technical solution.
>
> Using the DXL timer ...
This timer is a very nice thing. I know this technique from Visual-Basic-Software and there it works very well without any problems.
But in DXL it seems that you need a very tricky code because the standard routine to access some data is the for ... in ... do loop.
string something
for something in skipSomething do {
// Here you have something.
}
In the timer you cannot use it and there you need something like:
SetToFirst(skipSomething); // to initialize
and for the timer-loop
void TimerCallback (DBE x) {
If (!EndOfSkip(skipSomething)) {
string something = GetNextElement(skipSomething);
// do something with "something".
} else {
stopTimer theTimer;
}
}
Ist there any "simple" method to move a Skiplist to the next entry and to read the next entry without this loop?
>
> Now the problem with the DXL socket functions is, that you do not have non-blocking communication.
If you are at home in Eclipse you can write your own routine set.
There is a small tool that "contains support code to help you create in-process COM servers in Java".
May be that helps
Best regards
Wolfgang
|
|
Re: TCP DXL Server in background OurGuest - Sat Dec 22 18:22:05 EST 2012 SystemAdmin - Sat Dec 22 14:42:54 EST 2012
Hello
Some points:
>
> I think what you are asking is: Is it possible to have DOORS do parallel processing. Someone may have figure out away but never heard anyone doing it.
This ist not as difficult as you may think. It is only "expensive" because you need two (or more) doors licences to do it. The problems with your cost center responsible are more complicate than the technical solution.
>
> Using the DXL timer ...
This timer is a very nice thing. I know this technique from Visual-Basic-Software and there it works very well without any problems.
But in DXL it seems that you need a very tricky code because the standard routine to access some data is the for ... in ... do loop.
string something
for something in skipSomething do {
// Here you have something.
}
In the timer you cannot use it and there you need something like:
SetToFirst(skipSomething); // to initialize
and for the timer-loop
void TimerCallback (DBE x) {
If (!EndOfSkip(skipSomething)) {
string something = GetNextElement(skipSomething);
// do something with "something".
} else {
stopTimer theTimer;
}
}
Ist there any "simple" method to move a Skiplist to the next entry and to read the next entry without this loop?
>
> Now the problem with the DXL socket functions is, that you do not have non-blocking communication.
If you are at home in Eclipse you can write your own routine set.
There is a small tool that "contains support code to help you create in-process COM servers in Java".
May be that helps
Best regards
Wolfgang
In what world is using two DOORS process, called parallel processing?
|
|
Re: TCP DXL Server in background SystemAdmin - Mon Dec 31 00:51:51 EST 2012 OurGuest - Sat Dec 22 18:22:05 EST 2012
In what world is using two DOORS process, called parallel processing?
Do you see on other possibility? Independently if you want to start another process on a different PC or on the same PC but a different CPU you need a second doors licencse.
|
|
Re: TCP DXL Server in background llandale - Mon Jan 07 10:19:57 EST 2013 SystemAdmin - Mon Dec 31 00:51:51 EST 2012
Do you see on other possibility? Independently if you want to start another process on a different PC or on the same PC but a different CPU you need a second doors licencse.
Yes you can start a 2nd DOORS session and yes that (now) costs another license; but that is not "parellel processing".
As for your where-am-I-in-the-Skip-list problem, you can have a global variable that holds that last processed KEY.
string LastKey = ""
void Timer(..)
{ bool Found = false
bool Done = true
string CurrentKey = "", CurrentData = ""
if (null LastKey) then Found = true
for CurrentData in MySkip do
{ CurrentKey = (string key MySkip)
if (Found)
{ LastKey = CurrentKey
Done = false
break
}
if (CurrentKey == LastKey)
{ Found = true
}
}
if (!Done)
then {do the work using CurrentKey and CurrentData}
else {disable timer}
}
-Louie
|
|
Re: TCP DXL Server in background Mathias Mamsch - Fri Jan 11 05:21:32 EST 2013 llandale - Mon Jan 07 10:19:57 EST 2013
Yes you can start a 2nd DOORS session and yes that (now) costs another license; but that is not "parellel processing".
As for your where-am-I-in-the-Skip-list problem, you can have a global variable that holds that last processed KEY.
string LastKey = ""
void Timer(..)
{ bool Found = false
bool Done = true
string CurrentKey = "", CurrentData = ""
if (null LastKey) then Found = true
for CurrentData in MySkip do
{ CurrentKey = (string key MySkip)
if (Found)
{ LastKey = CurrentKey
Done = false
break
}
if (CurrentKey == LastKey)
{ Found = true
}
}
if (!Done)
then {do the work using CurrentKey and CurrentData}
else {disable timer}
}
-Louie
Did you guys ever use node locked licenses? You can open as many DOORS processes as you want if you have one of those. By the way, the SKIP list thing is much easier if you just use an integer index to put the stuff that you would normally process on the for loop in the skip. I think there should be something in the example of the link I posted.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: TCP DXL Server in background SystemAdmin - Tue Jan 15 03:20:54 EST 2013 llandale - Mon Jan 07 10:19:57 EST 2013
Yes you can start a 2nd DOORS session and yes that (now) costs another license; but that is not "parellel processing".
As for your where-am-I-in-the-Skip-list problem, you can have a global variable that holds that last processed KEY.
string LastKey = ""
void Timer(..)
{ bool Found = false
bool Done = true
string CurrentKey = "", CurrentData = ""
if (null LastKey) then Found = true
for CurrentData in MySkip do
{ CurrentKey = (string key MySkip)
if (Found)
{ LastKey = CurrentKey
Done = false
break
}
if (CurrentKey == LastKey)
{ Found = true
}
}
if (!Done)
then {do the work using CurrentKey and CurrentData}
else {disable timer}
}
-Louie
> but that is not "parellel processing".
If you are asked to do something and you cannot, rename something you can and you can do it. For every salesman and manager this is the way to become an expert.
|
|
Re: TCP DXL Server in background llandale - Wed Jan 16 11:45:34 EST 2013 Mathias Mamsch - Fri Jan 11 05:21:32 EST 2013
Did you guys ever use node locked licenses? You can open as many DOORS processes as you want if you have one of those. By the way, the SKIP list thing is much easier if you just use an integer index to put the stuff that you would normally process on the for loop in the skip. I think there should be something in the example of the link I posted.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
It does appear we used to have Node Locked Licenses but no longer do.
|
|